<?php

$templates_presets = config::read('templates', 'system');
$allowed_values    = array('default', 'inherit', 'disabled', 'base', 'article', 'articles');

if(!empty($_POST['f']))
{
   $inputData = $_POST['f'];
   foreach($templates_presets AS $k=>$v)
   {
      if(!empty($inputData[$k]) && in_array($inputData[$k], $allowed_values))
      {
         $templates_presets[$k] = $inputData[$k];
      }
   }
   
   config::write('templates', 'system', $templates_presets);
}

$SMARTY->assign('tpls', json_encode($templates_presets));

$layout = 'templates.html';
?>
